package asteroids.model.programs.parsing.types;

import be.kuleuven.cs.som.annotate.Basic;


public class BooleanLiteral extends Type {

	public BooleanLiteral(boolean result) {
		this.value= result;
	} 

	public BooleanLiteral(){
		this.value = false;
	}

	@Basic
	public Boolean getValue() {
		return value;
	}

	private Boolean value;

	@Override
	public String toString(){
		return(getValue().toString());
	}

	@Override
	public boolean equals(Object object){
		if(!(object instanceof BooleanLiteral)){
			return false;
		}
		boolean result = (((BooleanLiteral)object).getValue()==this.getValue());
		return result;
	}

	@Override
	public int hashCode(){
		return getValue() ? 1 : 0;		
	}
}
